package com.alameda.controller.user;

import com.alameda.api.user.UserOperateLogService;
import com.alameda.result.Result;
import com.alameda.user.dto.UserOperateLogDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户操作日志 前端控制层
 *
 * @author Lv
 * @date 2025/01/09
 */
@Api(tags = "用户操作日志")
@RestController
@RequestMapping("/user_operate_log")
public class UserOperateLogController {

    @Autowired
    private UserOperateLogService userOperateLogService;

    /**
     * 读取用户操作信息
     *
     * @param userOperateLogDTO 用户操作日志数据传递对象
     * @return
     */
    @ApiOperation("读取用户操作日志信息")
    @PostMapping("/list_user_operate_info")
    public Result<?> listUserOperateInfo(@RequestBody UserOperateLogDTO userOperateLogDTO) {
        return Result.success(userOperateLogService.listUserOperateInfo(userOperateLogDTO));
    }

    /**
     * 导出excel
     *
     * @param userOperateLogDTO 用户操作日志数据传递对象
     */
    @ApiOperation("导出excel")
    @PostMapping("/export_excel")
    public void exportExcel(@RequestBody UserOperateLogDTO userOperateLogDTO) {
        userOperateLogService.exportExcel(userOperateLogDTO);
    }
}

